/**
 * 预约班级
 */
'use strict'
import {Drawer} from "antd-mobile";
import {connect} from 'dva';
import React, {Component} from 'react';
import styles from '../../../routes/Book/Book.css';
import BookListProducts from "./BookListProducts";
import BookSearch from "./BookSearch";
import Condition from "./Condition";
import FilterCondition from "./Filter";

const TOP = <div>
  {/*顶部搜索*/}
  <BookSearch/>
  {/*过虑条件*/}
  <FilterCondition/>
</div>;

class FirstTest extends Component {
  render() {
    const {open} = this.props;
    return (
      <div className={styles.normal}>
        <Drawer
          style={{minHeight: open ? document.documentElement.clientHeight : 0}}
          className="my-drawer"
          enableDragHandle
          open={open}
          contentStyle={{color: '#A6A6A6', textAlign: 'center', paddingTop: 42}}
          sidebar={<Condition/>}
          position="top"
          touch
        >
          <div></div>
        </Drawer>
        {/*老师列表*/}
        <BookListProducts header={_ => TOP}/>
      </div>
    );
  }
}

FirstTest.propTypes = {};
const opts = ({book}) => {
  const {filterVisible = false} = book || {};
  //取当前题目
  return {
    open: filterVisible
  };
}
export default connect(opts)(FirstTest);
